package com.cn.study0014.test003;



import java.util.Scanner;

/**
 * @author lw
 * @ClassName TestCus.java
 * @Description
 * @createTime 2023年05月18日 14:45:00
 */
public class TestCus {
    public static void main(String[] args) {
        CustomerBiz cus=new CustomerBiz();
        Scanner sc=new Scanner(System.in);
        String sname;
        String mark;
        for (int i = 0; i < 10; i++) {
            System.out.print("请输入客户的姓名：");
            sname=sc.next();
            cus.addName(sname);
            System.out.print("继续输入吗？（y/n）:");
            mark = sc.next();
            if (mark.equals("y")){
                continue;
            }else if(mark.equals("n")){
                break;
            }else {
                System.out.println("输入错误！");
                break;
            }
        }
        cus.showName();

        System.out.print("\n请输入旧的客户姓名：");
        String oldName=sc.next();
        System.out.print("\n请输入新的客户姓名：");
        String newName=sc.next();
        System.out.println("*******修改结果*******");
        if (cus.editName(oldName, newName)){
            System.out.println("找到并修改成功！");
            cus.showName();
        }else {
            System.out.println("修改失败！");
        }


    }

}
